package com.cdtye.shuoh.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 字符类型
 *
 * @author Wangzhongwang
 * @date 2023-03-05
 */
@Getter
@AllArgsConstructor
public enum OperatorEnum {

    eq("=="),
    not("!="),
    gt(">"),
    lt("<"),
    gte(">="),
    lte("<="),
    between("between");

    private String symbol;

    public static OperatorEnum getBySymbol(String symbol) {
        for (OperatorEnum operatorEnum : values()) {
            if (operatorEnum.getSymbol().equals(symbol)) {
                //获取指定的枚举
                return operatorEnum;
            }
        }
        return null;
    }

}
